package com.qf.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * projectName: wokepase1
 *
 * @author: 强力
 * time: 2021/8/30 19:35
 * description:环绕通知
 * 在你执行service业务前后,都要执行这个环绕通知中添加的辅助功能方法
 */
public class RoundAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("辅助功能,环绕通知,开始事务");

        Object proceed = methodInvocation.proceed();

        System.out.println("辅助功能,环绕通知,提交事务");
        return null;
    }
}
